{% extends 'IcsocUIBundle::page.html.twig' %}
{% from 'IcsocUIBundle:Macro:grid.html.twig' import gridWidth,gridNav,gridConfig,gridKeyword,sendKeyWord %}
{% block stylesheet %}
    {{ parent() }}
    {% stylesheets
    '@jqgird_css'
    '@gritter_css'
    filter='cssrewrite' filter='uglifycss'
    %}
    <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

{% block content %}
    {{ gridKeyword('The process name'|trans) }}
    <table id="grid-table"></table>
    <div id="grid-pager"></div>
{% endblock %}
{% block footer %}
    {% javascripts
    '@jqgird_js'
    '@gritter_js'
    '@common_js'
    filter='uglifyjs'
    %}
    <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
    <script type="text/javascript">
        jQuery(function($) {
            {{ gridWidth() }}
            jQuery(grid_selector).jqGrid({
                url: "{{ path('icsoc_ivr_list_data') }}",  //数据；
                colNames:['{{ 'actions'|trans }}','','{{ 'The process name'|trans }}', '{{ 'Flow number'|trans }} ','{{ 'remark'|trans }}', '{{ 'Update time'|trans }}',
                    /*'{{ 'Whether the force'|trans}}',*/''],  //列显示名称，是一个数组对象
                colModel:[
                    {name:'myac',index:'', width:80, fixed:true, sortable:false, resize:false,
                        formatter:'actions',
                        formatoptions:{
                            keys:true,
                            editbutton:true,
                            editformbutton: true,
                            delOptions:{recreateForm: true, beforeShowForm:beforeDeleteCallback, afterSubmit:afterDeleteCallback,left:540,top:206},
                            editOptions:{width: "0",height: "0", jqModal:false, beforeShowForm:beforeEditCallback }
                        }
                    },
                    {name:'ivr_id',index:'ivr_id',width:80,hidden:true,editable: true, sortable:false, key:true},
                    {name:'ivr_name',index:'ivrName', width:180,editable: true, sortable:false},
                    {name:'ivr_code',index:'ivrCode', width:180,editable:true, sortable:false},
                    {name:'remark',index:'remark',width:250, editable:true, sortable:false},
                    {name:'update_time',index:'updateTime',editable:true, sortable:false},
                    /*{name:'if_refresh',index:'ifRefresh', editable:true,formatter:function(cellvalue, options, rowObject){
                        return cellvalue == 1 ? '是' : '<font color=red>否</font>';
                    }},*/
                    {name:'id',index:'id',hidden:true,editable: true, sortable:false, formatter:function(cell,opt,row){
                        return row.ivr_id;
                    }},
                ],
                {{ gridConfig() }}
                sortname: 'updateTime',
                editurl: "{{ path('icsoc_ivr_delete_data') }}",//nothing is saved 定义对form编辑时的url
                caption: "{{ 'IVR list'|trans }}"//表格名称
            });
            {{ gridNav(false,false,true,false,true,true,path('icsoc_ivr_add'),path('icsoc_ivr_edit')) }}
        });
        {{ sendKeyWord() }}
    </script>
{% endblock %}